import glob
import os

from gxl_ai_utils.utils import utils_file
from tqdm import tqdm

if __name__ == '__main__':
    """"""
    res_dic = {}
    root_dir = '/home/backup_nfs5/data_tts/wenetspeech/denoise.sh/'
    for root, dirs, files in os.walk(root_dir):
        for dirname in dirs:
            """"""
            dir_path = os.path.join(root, dirname)
            files = glob.glob(f"{dir_path}/*.wav")
            for file_path in tqdm(files, total=len(files), desc=dirname):
                """"""
                filename = file_path.split("/")[-1]
                key = filename.split('.')[0]
                res_dic[key] = file_path

        break
    utils_file.write_dic_to_scp(res_dic, '/home/backup_nfs5/data_tts/wenetspeech/wav.scp')
    print('over')